<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>业务消息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="#">多图文回复<shiro:hasPermission name="wechat:businessNewsReply:edit">${not empty businessNewsReply.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:businessNewsReply:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="businessNewsReply" action="${ctx}/wechat/businessNewsReply/save" method="post" class="form-horizontal"  enctype="multipart/form-data">
		<form:hidden path="id"/>
		<form:hidden path="user.id"/>
		<form:hidden path="type"/>
		<tags:message content="${message}"/>
		
		<label class="control-label">图片标题:</label>
		<div   class="controls" >
					<input type="text" name="title" htmlEscape="false" id="pic_title"  class="required"/>
				</div>
				
				<label class="control-label">链接地址:</label>
				<div   class="controls" style="margin-top:5px;margin-buttom:5px;">
					<input type="text" name="url" htmlEscape="false"  class="required"  id="pic_url"/>  &nbsp; <span class="alert">必须以 http://开头.</span>
				</div>
				
				<label class="control-label">排序:</label>
				<div class="controls" id="uploadfile" style="margin-top:5px;margin-buttom:5px;">
					<input type="text" name="sort" htmlEscape="false"  class="required digsts"  >    
				</div>
				<label class="control-label">图片描述:</label>
				<div   class="controls" style="margin-top:5px;margin-buttom:5px;">
					<textarea id="pic_desc" name="description" htmlEscape="false"  cols="6" rows="5" class="required"></textarea>
				</div>
				<label class="control-label">上传文件:</label>
				<div class="controls" id="uploadfile">
					<input type="file"  name="picfile"/> <span class="alert">大图片建议尺寸：720像素 * 400像素;  &nbsp; 小图片建议尺寸：400像素 * 400像素</span>    
				</div>				
				
								
				
				
		<div class="form-actions">
			<shiro:hasPermission name="wechat:businessNewsReply:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
	
	
	<br/>
	<ul class="nav nav-tabs">
		<li class="active"><a href="#">图文回复列表</a></li>
	</ul> 
	
	<table id="contentTable"   class="table table-striped table-bordered ">
		<thead>
		<tr> 
		<th width="20%">图片标题</th>
		<th width="30%">描述</th>
		<th width="10%">排序</th>
		<th width="30%">原文链接</th>
		<shiro:hasPermission name="wechat:newsReply:edit">
		<th width="10%">操作</th>
		</shiro:hasPermission>
		</tr>
		</thead>
		<tbody>
		<c:forEach items="${busiNewsList}" var="newsReply">
			<tr>
				<td nowrap="nowrap"  width="10%"><a href="${ctx}/wechat/businessNewsReply/form?id=${newsReply.id}&type=${newsReply.type}" >${newsReply.title}</a></td>
				<td nowrap="nowrap"  width="20%">${newsReply.description}</td>
				<td nowrap="nowrap" width="30%">${newsReply.sort}</td>
				<td ><a href="${newsReply.url}" target="_blank">${newsReply.url}</a> </td>
				<shiro:hasPermission name="wechat:newsReply:edit">
				<td nowrap="nowrap">
					<a href="${ctx}/wechat/businessNewsReply/form?id=${newsReply.id}&type=${newsReply.type}" >修改</a>
					<a href="${ctx}/wechat/businessNewsReply/delete?id=${newsReply.id}" onclick="return confirmx('确认要删除该条记录吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>
